Segment Feed
Segments are groups of users according to meaningful merchant-defined attributes like age, gender, demonstrated behavior, and spend. Both Recommend and Engage make use of segments in determining recs and content. Merchants can provide their pre-defined segments via a feed and this document describes that feed format and process for providing that data to Algonomy.
This segment feed does not need to be uploaded daily; it should only be uploaded when there are changes or updates to the segment data. This is usually scheduled to happen regularly, be it weekly, monthly, or another suitable interval. This can also be done individually via API or JavaScript tags. Please consult your Algonomy representative if you're interested in this option. You can also find more information in the Feature Integration section.
A segment is defined within the Omnichannel Personalization Cloud as a concatenation of a segment ID and a segment name. Each thus -defined segment is unique.
Unlike catalog and content feeds, which use pipe-delimited csv file formats with .txt extensions, segment feeds are sent to us as JSON data. Segments are passed in with user IDs in a JSON object consisting of two items: the user ID and the associated values for it. The associated values are held in another object, which is a list of hashes composed of the segment ID and name.
-
Segment ID: this is the ID of the segment.
-
Segment name: this associates the segmentID with a human-readable name. This is optional. If you don't have a segment name to pass in, pass in an empty string ("") in its place.
Example: "seg123":"DogOwner"
The segment ID and name are unique. After you've set "seg123" to "DogOwner" it cannot be associated with another segment name.
With the User Profile Service, we now can load segments for each user via the User Profile batch upload process. In the User Segment file you associate user IDs with the segments they belong to. This can then be used to update the user information in the User Profile Service. The file format is given below, and for more information on the batch upload process please click here.
Feed File
Feed File |
Details |
Filename pattern |
---|---|---|
Segment Feed |
A JSON-formatted data file of segment data for your site. |
segments_sitename_YYYY_MM_DD.txt |
File Specifications
The Omnichannel Personalization Cloud supports both full feed type of import and an incremental (delta type of feed) for the User Profile service. In addition to segments, the platform supports the import of user attributes, user linkings, and user preferences via the Batch Feed process or via User Profile Enrichment APIs.
Note: For more information on the additional information that can be imported with the User Profile service, refer to User Profile Batch Upload.
The feed file requires one JSON object per line. Each object will contain two fields:
Name |
Type |
Required? |
Definition |
---|---|---|---|
userId |
ASCII |
Yes |
A unique identifier for the user. |
Value |
text |
Yes |
A valid JSON object that gives the unique segment identifiers and the human-friendly name of each segment for the individual user as a key : value pair. The segment value can be a string or a numeric value. |
Sample
{"userId": "13579", "value":{"seg2134":"Dog Owner", "seg50plus":"High Spender", "Platinum": "Platinum Member"}}
Note: Each unique segment identifier is meant to have a unique context or value.
To upload the file, follow the basic FTP Instructions found here in the section titled "Upload the file."